<extend name="Base/common"/>

<block name="style">
    <link href="__CSS__/event.css" rel="stylesheet" type="text/css"/>
</block>
<block name="header">
    <include file="_nav"/>
</block>
<block name="body">
<!--导航-->


    <div class="col-xs-3 pull-right" style="z-index: 99">
        <include file="_right"/>
    </div>


    <div class="col-xs-9">


        <div class="forum_module" style="width: 100%;min-height: 800px;">

        <div class="row" style="padding: 10px 10px 0 0 ">
            <div class="col-xs-12">
                <div class="event_header_title">
                    <div class="pull-left">{:L('_MY_EVENT_')}</div>
                    <div class="btn-group btn-group-sm  pull-right" style="margin-bottom:5px;">
                        <a href="{:U('myevent',array('lora'=>'','type_id'=>$type_id))}"
                           class="btn btn-default <if condition="$lora
                           eq ''">active</if>">{:L('_MY_SPONSOR_')}</a>
                        <a href="{:U('myevent',array('lora'=>'attend','type_id'=>$type_id))}"
                           class="btn btn-default <if condition="$lora eq 'attend'">active</if>">{:L('_MY_IN_')}</a>
                    </div>
                </div>
            </div>

        </div>

            <volist name="contents" id="vo">
                <div class="clearfix event_list">
                    <div class="col-xs-5" style="padding: 0">
                        <if condition="time() lt $vo['eTime']">
                            <div class="event_state" style="background: #d61f39">
                                {:L('_IN_PROGRESS_')}
                            </div>
                            <else/>
                            <div class="event_state" style="background: #000;">
                                {:L('_ALREADY_OVER_')}
                            </div>
                        </if>

                        <a class="pull-left" href="{:U('Event/Index/detail',array('id'=>$vo['id']))}"> <img
                                class=""
                                src="{$vo.cover_id|getThumbImageById=320,210}" style="width: 320px;height: 210px;"/></a>
                    </div>
                    <div class="pull-left col-xs-7">
                        <div class="mgl20 event_title"><a href="{:U('Event/Index/detail',array('id'=>$vo['id']))}"
                                                          class="text-more" style="width: 100%">{$vo.title}</a></div>
                        <div class="event_fq_count pull-left">
                            <div class="pull-left mgb10 col-xs-12">
                                <div class="pull-left col-xs-6 " style="padding-left: 5px;">by&nbsp; <a class=""
                                                                                                        href="{$vo.user.space_url}">
                                    <span class="event_count">{$vo.user.nickname}</span></a></div>
                                <div title="{:L('_TITLE_APPLY_COUNT_')}" class="pull-left col-xs-3">
                                    <div class="event_logo" style=""></div>
                                    <span class="event_count">&nbsp;{$vo.signCount}人</span></div>
                                <div class="pull-left col-xs-3">
                                    <div class="event_logo" style="background-position: -20px 0px;"></div>
                                    <span class="event_count">&nbsp;{$vo.view_count}</span></div>
                            </div>
                            <div class="pull-left mgb10">
                                <div class="pull-left mgl20 " style="font-size: 14px;">{:L('_TIME_')}{:L('_COLON_')}
                                    {:date('Y-m-d',$vo['sTime'])}--{:date('Y-m-d',$vo['eTime'])} &nbsp;&nbsp;
                                    {$vo.type.title}
                                </div>
                            </div>

                            <div class="pull-left mgb10">
                                <div class="pull-left mgl20 " style="font-size: 14px;">{:L('_REGISTRATION_TIME_DEADLINE_')}{:L('_COLON_')}
                                    {:date('Y-m-d',$vo['deadline'])} &nbsp;&nbsp;

                                </div>
                            </div>
                            <div class="word-wrap pull-left mgl20 event_short_explain" style="width: 80%">{:L('_INTRO_')}{:L('_COLON_')}
                                {$vo.explain|op_t|getShortSp=30}
                            </div>
                            <div class="pull-left mgl20 mgt10" style=" ">
                                <div class="btn-group">
                                    <if condition="($vo['uid'] eq is_login()) OR is_administrator(is_login())">

                                        <if condition="time() lt $vo['eTime']">
                                            <a class="btn btn-default endEvent" data-eventID="{$vo.id}">{:L('_OVER_AHEAD_')}</a>
                                        </if>

                                        <a href="{:U('edit',array('id'=>$vo['id']))}" class="btn btn-default">{:L('_EVENT_EDIT_')}</a>
                                        <a class="btn btn-default delEvent" data-eventID="{$vo.id}">{:L('_EVENT_DELETE_')}</a>
                                    </if>
                                    <if condition="($vo['uid'] neq is_login())">
                                        <php>if(!$vo['check_isSign']){</php>

                                        <php>if($vo['deadline'] < time()){</php>
                                        <a class="btn btn-default  " href="javascript:"
                                           onclick="toast.error({:L('')})">{:L('_REGISTRATION_HAS_OVER_')} </a>
                                        <php>}else{</php>
                                        <if condition="is_login() eq 0">
                                            <a class="btn btn-info  " href="javascript:" style="color: #fff"
                                               onclick="toast.error({:L('_ERROR_REGISTER_AFTER_LOGIN_')})">{:L('_REGISTER_OP_')} </a>
                                            <else/>
                                            <if condition="check_auth('Event/Index/doSign')">
                                                <a class="btn btn-primary event_sign " style="color: #fff"
                                                   href="{:U('ajax_sign',array('event_id'=>$vo['id']))}">{:L('_REGISTER_OP_')} </a></if>
                                        </if>
                                        <php>}</php>
                                        <php>}else{</php>
                                        &nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-default unSign"
                                                                   data-eventID="{$vo.id}" href="javascript:"
                                                                   id="unSign">{:L('_REGISTER_CANCEL_')} </a>

                                        <span style="line-height: 34px;"> {:L('_REGISTER_ED_')}&nbsp;&nbsp;&nbsp;&nbsp;<if
                                                condition="$vo['check_isSign'][0]['status'] eq 1">{:L('_AUDIT_ED_')}
                                            <else/>
                                            {:L('_AUDIT_OP_')}
                                        </if></span>

                                        <php>}</php>

                                    </if>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </volist>
            <div class="row issue_list">


                <if condition="count($contents) eq 0">
                    <div style="font-size:3em;padding:2em 0;color: #ccc;text-align: center">{:L('_TIP_EMPTY_')}</div>
                </if>

            </div>
    </div>


        <div>
            <div class="pull-right">

                {:getPagination($totalPageCount,10)}
            </div>
        </div>

    </div>


</block>

<block name="script">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <script type="text/javascript" src="__JS__/event.js"></script>
    <script>
        $(function () {
            $('#top_nav >li >a ').mouseenter(function () {
                $('.children_nav').hide();
                $('#children_' + $(this).attr('data')).show();
            });

            $('.event_sign').magnificPopup({
                type: 'ajax',
                overflowY: 'scroll',
                modal: true,
                callbacks: {
                    ajaxContentAdded: function () {
                        // Ajax content is loaded and appended to DOM

                        console.log(this.content);
                    }
                }
            });

        })


    </script>

    <script type="text/javascript">
        var SUPPORT_URL = "{:addons_url('Support://Support/doSupport')}";

    </script>
</block>










